package com.tanhua.server.service;

import com.tanhua.dubbo.api.db.SettingApi;
import com.tanhua.dubbo.api.db.UserInfoApi;
import com.tanhua.model.db.BlackList;
import com.tanhua.model.db.Question;
import com.tanhua.model.vo.PageResult;
import com.tanhua.model.vo.QuestionVo;
import com.tanhua.model.vo.SettingsVo;
import com.tanhua.model.vo.UserInfoVoAge;
import com.tanhua.server.interceptor.UserHolder;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SettingService {

    @DubboReference
    private SettingApi settingApi;

    @DubboReference
    private UserInfoApi userInfoApi;


    public Void setQuestion(QuestionVo questionVo) {
        questionVo.setUserId(UserHolder.getUserId());

        settingApi.setQuestion(questionVo);

        return null;
    }

    public void notifications(SettingsVo settingsVo) {
        settingApi.setNotification(settingsVo);
    }

    public PageResult<UserInfoVoAge> blackListPage(Long page, Long pagesize) {

        return userInfoApi.getbalckList(UserHolder.getUserId(), page, pagesize);
    }
}
